 /* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

资源编排
资源编排

OpenAPI spec version: v1
Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/


#import <Foundation/Foundation.h>
#import <JDCloudOCSDKJdro/JdroExecutor.h>

@implementation JdroClient

@synthesize userAgent = _userAgent;
@synthesize serviceName = _serviceName;
@synthesize version = _version;

-(void) addCustomerHeaderWithKey:(NSString*) key
                           value:(NSString*) value{
    if(![self customHeader])
    {
        self.customHeader = [[NSMutableDictionary alloc] init];
    }
    if(key && value)
    {
        [[self customHeader] setValue:value forKey:key];
    }
   
}

-(id)initWithGlobalConfig{
    if(![GlobalConfig credential])
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@"GlobalConfig credential not config" userInfo:nil];
        @throw e;
    }
    self.credential = [GlobalConfig credential];
    if(![GlobalConfig sdkEnvironment])
    {
        self.sdkEnvironment = [[SDKEnvironment alloc] initWithEndPoint:@"jdro.jdcloud-api.com"];
    }else
    {
        self.sdkEnvironment = [GlobalConfig sdkEnvironment];
    }
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 jdro  v1";
    _serviceName = @"jdro";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}

-(id)initWithCredential:(Credential*)credential
         sdkEnvironment:(SDKEnvironment*)sdkEnvironment
{
    if(!credential)
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@" credential can not null" userInfo:nil];
        @throw e;
    }else{
        self.credential = credential;
    }
    
    if(!sdkEnvironment)
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@" sdkEnvironment can not null" userInfo:nil];
        @throw e;
    }else{
        self.sdkEnvironment = sdkEnvironment;
    }
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 jdro  v1";
    _serviceName = @"jdro";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}

-(id)initWithCredential:(Credential*)credential
{
    if(!credential)
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@" credential can not null" userInfo:nil];
        @throw e;
    }else{
        self.credential = credential;
    }
    if(![GlobalConfig sdkEnvironment])
    {
        self.sdkEnvironment = [[SDKEnvironment alloc] initWithEndPoint:@"jdro.jdcloud-api.com"];
    }else
    {
        self.sdkEnvironment = [GlobalConfig sdkEnvironment];
    }
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 jdro  v1";
    _serviceName = @"jdro";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}

-(id)init{
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 jdro  v1";
    _serviceName = @"jdro";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}


/**
describeStacks sync request
@param describeStacksRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeStacksResponse` the request response data model
*/
-(NSDictionary*) describeStacksSyncWithRequest:(JdroDescribeStacksRequest*) describeStacksRequest
{
JdroDescribeStacksExecutor* excutor = [[JdroDescribeStacksExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeStacksRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdroDescribeStacksResponse* response = [[JdroDescribeStacksResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeStacksResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeStacksAsyncWithRequest:(JdroDescribeStacksRequest*) describeStacksRequest
                       completionHandler:(void(^)(int statusCode,JdroDescribeStacksResponse* _Nullable describeStacksResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
JdroDescribeStacksExecutor* excutor = [[JdroDescribeStacksExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeStacksRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdroDescribeStacksResponse* response = [[JdroDescribeStacksResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeStackEvents sync request
@param describeStackEventsRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeStackEventsResponse` the request response data model
*/
-(NSDictionary*) describeStackEventsSyncWithRequest:(JdroDescribeStackEventsRequest*) describeStackEventsRequest
{
JdroDescribeStackEventsExecutor* excutor = [[JdroDescribeStackEventsExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeStackEventsRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdroDescribeStackEventsResponse* response = [[JdroDescribeStackEventsResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeStackEventsResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeStackEventsAsyncWithRequest:(JdroDescribeStackEventsRequest*) describeStackEventsRequest
                       completionHandler:(void(^)(int statusCode,JdroDescribeStackEventsResponse* _Nullable describeStackEventsResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
JdroDescribeStackEventsExecutor* excutor = [[JdroDescribeStackEventsExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeStackEventsRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdroDescribeStackEventsResponse* response = [[JdroDescribeStackEventsResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeStackResources sync request
@param describeStackResourcesRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeStackResourcesResponse` the request response data model
*/
-(NSDictionary*) describeStackResourcesSyncWithRequest:(JdroDescribeStackResourcesRequest*) describeStackResourcesRequest
{
JdroDescribeStackResourcesExecutor* excutor = [[JdroDescribeStackResourcesExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeStackResourcesRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdroDescribeStackResourcesResponse* response = [[JdroDescribeStackResourcesResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeStackResourcesResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeStackResourcesAsyncWithRequest:(JdroDescribeStackResourcesRequest*) describeStackResourcesRequest
                       completionHandler:(void(^)(int statusCode,JdroDescribeStackResourcesResponse* _Nullable describeStackResourcesResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
JdroDescribeStackResourcesExecutor* excutor = [[JdroDescribeStackResourcesExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeStackResourcesRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdroDescribeStackResourcesResponse* response = [[JdroDescribeStackResourcesResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
createChangeSet sync request
@param createChangeSetRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `createChangeSetResponse` the request response data model
*/
-(NSDictionary*) createChangeSetSyncWithRequest:(JdroCreateChangeSetRequest*) createChangeSetRequest
{
JdroCreateChangeSetExecutor* excutor = [[JdroCreateChangeSetExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:createChangeSetRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdroCreateChangeSetResponse* response = [[JdroCreateChangeSetResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"createChangeSetResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)createChangeSetAsyncWithRequest:(JdroCreateChangeSetRequest*) createChangeSetRequest
                       completionHandler:(void(^)(int statusCode,JdroCreateChangeSetResponse* _Nullable createChangeSetResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
JdroCreateChangeSetExecutor* excutor = [[JdroCreateChangeSetExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:createChangeSetRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdroCreateChangeSetResponse* response = [[JdroCreateChangeSetResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
createStack sync request
@param createStackRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `createStackResponse` the request response data model
*/
-(NSDictionary*) createStackSyncWithRequest:(JdroCreateStackRequest*) createStackRequest
{
JdroCreateStackExecutor* excutor = [[JdroCreateStackExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:createStackRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdroCreateStackResponse* response = [[JdroCreateStackResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"createStackResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)createStackAsyncWithRequest:(JdroCreateStackRequest*) createStackRequest
                       completionHandler:(void(^)(int statusCode,JdroCreateStackResponse* _Nullable createStackResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
JdroCreateStackExecutor* excutor = [[JdroCreateStackExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:createStackRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdroCreateStackResponse* response = [[JdroCreateStackResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeStack sync request
@param describeStackRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeStackResponse` the request response data model
*/
-(NSDictionary*) describeStackSyncWithRequest:(JdroDescribeStackRequest*) describeStackRequest
{
JdroDescribeStackExecutor* excutor = [[JdroDescribeStackExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeStackRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdroDescribeStackResponse* response = [[JdroDescribeStackResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeStackResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeStackAsyncWithRequest:(JdroDescribeStackRequest*) describeStackRequest
                       completionHandler:(void(^)(int statusCode,JdroDescribeStackResponse* _Nullable describeStackResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
JdroDescribeStackExecutor* excutor = [[JdroDescribeStackExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeStackRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdroDescribeStackResponse* response = [[JdroDescribeStackResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeStackTemplate sync request
@param describeStackTemplateRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeStackTemplateResponse` the request response data model
*/
-(NSDictionary*) describeStackTemplateSyncWithRequest:(JdroDescribeStackTemplateRequest*) describeStackTemplateRequest
{
JdroDescribeStackTemplateExecutor* excutor = [[JdroDescribeStackTemplateExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeStackTemplateRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdroDescribeStackTemplateResponse* response = [[JdroDescribeStackTemplateResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeStackTemplateResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeStackTemplateAsyncWithRequest:(JdroDescribeStackTemplateRequest*) describeStackTemplateRequest
                       completionHandler:(void(^)(int statusCode,JdroDescribeStackTemplateResponse* _Nullable describeStackTemplateResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
JdroDescribeStackTemplateExecutor* excutor = [[JdroDescribeStackTemplateExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeStackTemplateRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdroDescribeStackTemplateResponse* response = [[JdroDescribeStackTemplateResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
executeChangeSet sync request
@param executeChangeSetRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `executeChangeSetResponse` the request response data model
*/
-(NSDictionary*) executeChangeSetSyncWithRequest:(JdroExecuteChangeSetRequest*) executeChangeSetRequest
{
JdroExecuteChangeSetExecutor* excutor = [[JdroExecuteChangeSetExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:executeChangeSetRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdroExecuteChangeSetResponse* response = [[JdroExecuteChangeSetResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"executeChangeSetResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)executeChangeSetAsyncWithRequest:(JdroExecuteChangeSetRequest*) executeChangeSetRequest
                       completionHandler:(void(^)(int statusCode,JdroExecuteChangeSetResponse* _Nullable executeChangeSetResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
JdroExecuteChangeSetExecutor* excutor = [[JdroExecuteChangeSetExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:executeChangeSetRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdroExecuteChangeSetResponse* response = [[JdroExecuteChangeSetResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
deleteStack sync request
@param deleteStackRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `deleteStackResponse` the request response data model
*/
-(NSDictionary*) deleteStackSyncWithRequest:(JdroDeleteStackRequest*) deleteStackRequest
{
JdroDeleteStackExecutor* excutor = [[JdroDeleteStackExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:deleteStackRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdroDeleteStackResponse* response = [[JdroDeleteStackResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"deleteStackResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)deleteStackAsyncWithRequest:(JdroDeleteStackRequest*) deleteStackRequest
                       completionHandler:(void(^)(int statusCode,JdroDeleteStackResponse* _Nullable deleteStackResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
JdroDeleteStackExecutor* excutor = [[JdroDeleteStackExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:deleteStackRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdroDeleteStackResponse* response = [[JdroDeleteStackResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
validateTemplate sync request
@param validateTemplateRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `validateTemplateResponse` the request response data model
*/
-(NSDictionary*) validateTemplateSyncWithRequest:(JdroValidateTemplateRequest*) validateTemplateRequest
{
JdroValidateTemplateExecutor* excutor = [[JdroValidateTemplateExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:validateTemplateRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdroValidateTemplateResponse* response = [[JdroValidateTemplateResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"validateTemplateResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)validateTemplateAsyncWithRequest:(JdroValidateTemplateRequest*) validateTemplateRequest
                       completionHandler:(void(^)(int statusCode,JdroValidateTemplateResponse* _Nullable validateTemplateResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
JdroValidateTemplateExecutor* excutor = [[JdroValidateTemplateExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:validateTemplateRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdroValidateTemplateResponse* response = [[JdroValidateTemplateResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeResourceTypeSpecification sync request
@param describeResourceTypeSpecificationRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeResourceTypeSpecificationResponse` the request response data model
*/
-(NSDictionary*) describeResourceTypeSpecificationSyncWithRequest:(JdroDescribeResourceTypeSpecificationRequest*) describeResourceTypeSpecificationRequest
{
JdroDescribeResourceTypeSpecificationExecutor* excutor = [[JdroDescribeResourceTypeSpecificationExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeResourceTypeSpecificationRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdroDescribeResourceTypeSpecificationResponse* response = [[JdroDescribeResourceTypeSpecificationResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeResourceTypeSpecificationResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeResourceTypeSpecificationAsyncWithRequest:(JdroDescribeResourceTypeSpecificationRequest*) describeResourceTypeSpecificationRequest
                       completionHandler:(void(^)(int statusCode,JdroDescribeResourceTypeSpecificationResponse* _Nullable describeResourceTypeSpecificationResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
JdroDescribeResourceTypeSpecificationExecutor* excutor = [[JdroDescribeResourceTypeSpecificationExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeResourceTypeSpecificationRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdroDescribeResourceTypeSpecificationResponse* response = [[JdroDescribeResourceTypeSpecificationResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeResourceTypeList sync request
@param describeResourceTypeListRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeResourceTypeListResponse` the request response data model
*/
-(NSDictionary*) describeResourceTypeListSyncWithRequest:(JdroDescribeResourceTypeListRequest*) describeResourceTypeListRequest
{
JdroDescribeResourceTypeListExecutor* excutor = [[JdroDescribeResourceTypeListExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeResourceTypeListRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdroDescribeResourceTypeListResponse* response = [[JdroDescribeResourceTypeListResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeResourceTypeListResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeResourceTypeListAsyncWithRequest:(JdroDescribeResourceTypeListRequest*) describeResourceTypeListRequest
                       completionHandler:(void(^)(int statusCode,JdroDescribeResourceTypeListResponse* _Nullable describeResourceTypeListResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
JdroDescribeResourceTypeListExecutor* excutor = [[JdroDescribeResourceTypeListExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeResourceTypeListRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    JdroDescribeResourceTypeListResponse* response = [[JdroDescribeResourceTypeListResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}


 /**
 jdro common sync request
 @param  jdcloudDataRequest request param
 @return key `statusCode` http request status code type is int
             `dataResult` the http request response data  type is NSData
             `requestError` the request error type is NSError
 */
 -(NSDictionary*) jdroCommonSyncWithRequest:(JDCloudDataRequest*) jdcloudDataRequest
                                                   url:(NSString*) url
                                                method:(NSString*) method{
    CommonExecutor* excutor = [[CommonExecutor alloc] initWithJDCloudClient:self url:url method:method];
    NSDictionary* responseResult = [excutor executeDataSync:jdcloudDataRequest];
    return responseResult;
}

-(void)jdroCommonAsyncWithRequest:(JDCloudDataRequest*) jdcloudDataRequest
                                         url:(NSString*) url
                                      method:(NSString*) method
                           completionHandler:(void(^)(int statusCode, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
     CommonExecutor* excutor = [[CommonExecutor alloc] initWithJDCloudClient:self url:url method:method];
    
    [excutor executeDataAsync:jdcloudDataRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        completionHandler(statusCode,responseData,error);
    }];
} 

@end
